/**
 * 获取套接字对象
 * @param suffix
 * @param hostname
 * @param port
 * @constructor
 */
let GetWebSocket = (suffix: string, hostname: string, port: number) => new Promise((resolve, reject) => {
    let socket = new WebSocket(`ws://${hostname}:${port}/${suffix}`);

    socket.onopen = () => {
        resolve(socket);
    }
});

export {GetWebSocket};